package com.contain.stack;

import java.util.Stack;

/**
 * 栈：先进后出
 * 
 * @author Administrator
 * 
 */
public class Test1 {

	public static void main(String[] args) {
		//Stack类过时了
		Stack<String> stack = new Stack<String>();
		for (String s : "my name is zhang su lei".split(" ")) {
			stack.push(s);
		}
		while (!stack.empty()) {
			System.out.println(stack.pop());
		}
	}

}
